@extends('layouts.app')

@section('content')

@include('UEditor::head')

<!-- 加载编辑器的容器 -->
<!-- <div class="col-md-6 col-md-offset-3">
	<script id="container" name="content" type="text/plain"></script>
</div> -->

<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('container', {
	toolbars: [
    ['fullscreen', 'source', 'undo', 'redo'],
    ['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']
],
	lang: "zh-cn",
    initialFrameHeight : 200,
    autoFloatEnabled: true,
});
</script>

<form action="{{route('article.insert')}}" method="POST">
<div class="col-md-6 col-md-offset-3">
@if (count($errors) > 0)
    <div class="alert alert-danger">
        <ul>
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif
	{!! csrf_field() !!}
	<input type="text" name="title" class="form-control" style="margin-bottom:20px;" placeholder="输入标题" value="{{ old('title') }}" />
	<script id="container" name="content" type="text/plain" style="margin-bottom:20px;">
    </script>
	<div class="col-md-4" style="padding:0;">
		<input type="text" name="tag" class="form-control" placeholder="输入标签" value="{{ old('tag') }}" />
	</div>
	<button class="btn btn-primary pull-right">发表</button>
</div>
</form>
@endsection